import api from './requer'
//引入axios
import axios from 'axios'

export let getlist = (data={})=>{
  //使用axios 引入requer中的路径再加上参数实现获取数据
    return axios.get(`${api.url}home/videos/0/20`)
    .then(function (response) {
      return response.data
    })
  
}


export let getrecommend = (data={})=>{
  return axios.get(`${api.url}home/recommended/20/10`)
  .then(function (response) {
    return response.data
  })

}

export let getnote = (data={})=>{
  return axios.get(`${api.url}home/notes/0/20`)
  .then(function (response) {
    return response.data
  })

}

export let search = (data={})=>{
  return axios.get(`${api.url}recipe/search`,{params:data})
  .then(function (response) {
    return response.data
  })
}


export let Caidetails = (data)=>{
  return axios.get(`${api.url}recipe/detail/${data}`)
  .then(function (response) {
    return response.data
  })
}

export let Notedetails = (data)=>{
  return axios.get(`${api.url}note/detail/${data}`)
  .then(function (response) {
    return response.data
  })
}